1. Field of the Invention
The present invention relates to a method for controlling a computer, a computer, and a storage medium, and in particular, to a method for controlling a computer of booting a second OS different from a first OS that is usually booted on a computer, a computer where the above-described method is applied, and a storage medium where a program for realizing the above-described method by a computer is recorded.
2. Description of the Related Art
As operating systems for computers (hereinafter, OS(s)), there are various types of OSs, and each OS has characteristic different from each other. For this reason, even if a specific OS is installed so that the OS may be fixedly booted, it may become necessary to boot another OS. For example, it is desirable that an application program updating firmware such as a BIOS is executed under an environment where an OS (e.g., DOS (Disk Operating System)) operates, where only a single task is executable, rather than an environment where an OS having a function of executing a plurality of tasks in parallel (e.g., Microsoft Windows) operates.
As a method for booting an OS (hereinafter, this is called a second OS conveniently) which is different from an OS (hereinafter, this is called a first OS conveniently) usually booted when a computer is booted, a method is known. The method in which the second OS is booted by storing a boot image (a series of instruction codes which is read and executed in turn from a head thereof so that the OS is booted) in a floppy disk (FD), which is used for booting the second OS, setting the floppy disk in a floppy disk drive (FDD), and booting a computer system.
In addition, as another method, a technology is also known, the technology which is such that firmware built in a network adapter connected to a computer communicates with a server via a network without using function of an OS to acquire information, which is used for booting the second OS, from the server, and makes the second OS boot remotely in the computer.
Nevertheless, there is such a disadvantage that the method of setting an FD in an FDD cannot be applied to a computer not having the FDD. In addition, work of creating an FD for booting the second OS and of setting the created FD in the FDD is complicated, and the more the number of computers to boot increase, the more the work to create the FDD becomes complicated.
In addition, in the method that firmware built in a network adapter communicates with a server and acquires information from the server, communication between the firmware and server is realized with a specific bootstrap protocol (e.g., a bootstrap protocol or the like in an RFC951 (Internet Request For Comments 951) that is defined by IETF (Internet Engineering Task Force)). Therefore, this method has such a problem that the server must support the specific protocol and acquisition of the information used for booting an OS is limited, due to influences of network components such as a firewall and a router, and hence general versatility is poor.
Furthermore, as still another method of booting a second OS, it is also conceivable selectively to boot two or more kinds of OSs by dividing a storage space of a hard disk or the like into a plurality of partitions, storing boot images used for booting OSs different from each other in respective partitions, and booting a computer after rewriting a master boot record determining which partition is accessed to boot an OS when the computer is booted.
Nevertheless, this method has problems to effectively use the storage space of the hard disk since one of the plurality of partitions is occupied to boot the second OS even if a utilization rate of the second OS is low, since the partition including the boot image for booting the second OS resides in the storage space of the hard disk, and to easily create a partition for the second OS after installing a first OS.
In addition, in the method of storing the boot image of a second OS in a hard disk (similar to the method of storing the boot image in an FD), it is common to also store an application program or the like, which are to be executed under the control of the second OS. Nevertheless, for example, for update of firmware that is an example of processing to be executed by switching an OS, it is necessary to acquire a latest application program for updating the firmware to the latest firmware after version-up. Therefore, there are hardly advantages even if such an application program resides in the hard disk. In addition, although it is conceivable to delete the application program from the hard disk after executing the application program, this also has such a problem that deletion work is complicated. Furthermore, generally speaking, if file systems of the first and second OSs are different from each other, it is difficult to perform the update and deletion of an application on the second OS from an application on the first OS.
The present invention is conducted in consideration of the above facts, and its object is to acquire a method for controlling a computer that can easily realize the switching between OSs that are booted in a computer, and is excellent in general versatility.
Furthermore, anther object is to provide a method for switching an OS, which is booted, without modifying hardware and firmware of an existing computer.
Moreover, still another object of the present invention is to acquire a computer and a storage medium that can easily switch an OS to be booted.
A method for controlling a computer according to the steps of acquiring information, being used for booting a second OS and being different from a first OS, under control of the first OS in a state where the first OS is operating on the computer; writing the acquired information, in a main storage unit of the computer; and booting the second OS on the computer with the information written in the main storage unit without deleting the information written in the main storage unit, when termination of the first OS is detected.
In addition, for example, the information for booting the second OS can be configured to include a boot image file (a file configured with data showing a boot image) for booting the second OS. Furthermore, the information for booting the second OS can also include a program (this program can be fixedly stored in the computer) for writing the information, which is used for booting the second OS, in a main storage unit of the computer, and a program to be executed after booting the second OS.
In addition, concretely, it is possible to acquire the information, which is used for booting the second OS, for example, by receiving the information as a file from the outside of the computer via a communication line under the control of the first OS. In this case, since the communication with a server is performed under the control of the first OS, it is possible to easily acquire the information, which is used for booting the second OS, for example, in a general purpose communication mode which can be used under the control of the first OS, without depending on a specific protocol for remotely booting the second OS (e.g., to download the information as a file from a Web server (network drive) by a Web browser, to receive the information as an attachment to e-mail, or the like).
Furthermore, in the case where the information that is used for booting the second OS is acquired by receiving the information as a file from the outside via a communication line, the information acquired can be directly stored in the main storage unit of the computer that comprises a memory or the like. Nevertheless, so long as the information is temporarily stored in the secondary storage unit of the computer that comprises a hard disk or the like, it is possible to prevent a memory area of the main storage unit from being oppressed in a period when the information acquired is written in the main storage unit thereafter.
Moreover, in the case where the information that is used for booting the second OS is written beforehand in the secondary storage unit of the computer, it can be performed to acquire the information, which is used for booting the second OS, by reading the information from the secondary storage unit under the control of the first OS. In this mode, it can be performed to acquire the information, which is used for booting the second OS and for being written beforehand in the secondary storage unit, by receiving the information from the outside via a communication line. In addition, if a drive of an information-storage medium such as an FD is provided in the computer, it is possible to acquire the information by reading the information from the information-storage medium where the information is written.
Furthermore, in the present invention, if the information acquired is written in the main storage unit of the computer and the termination of the first OS is detected, the second OS is booted in the computer with the information written in the main storage unit without deleting the information written in the main storage unit. Although information stored in the main storage unit is deleted in the case where the computer is rebooted, in the present invention, the information written in the main storage unit is not deleted. Hence, it is possible to make the second OS with the information written in the main storage unit.
In addition, the information written in the main storage unit is deleted when the computer is next rebooted. Therefore, in order to boot the second OS, a storage area of the secondary storage unit is never oppressed, for example, by dividing the storage area of the secondary storage unit into a plurality of partitions and fixedly storing the information in specific partitions, and it is not necessary to perform complicated work such as rewriting a master boot record or activating the computer with setting an FD. Furthermore, it is possible to perform booting the second OS even if an FDD is not provided in the computer.
Therefore, according to the present invention, it is possible to easily switch from the first OS to the second OS that is different from the first OS, and is also excellent in general versatility since it is possible to implement the present invention without depending on a specific protocol for booting the second OS remotely.
By the way, if a boot image file of the second OS is included in the information for booting the second OS, booting the second OS is realized by executing a bootstrap code of firmware accessing an area of the main storage unit, where the boot image file of the second OS is written in the main storage unit after the first OS is terminated.
In addition, it is possible to realize that the area of the main storage unit, where the boot image file of the second OS is written, is made accessed by the bootstrap code of the firmware, by hooking secondary storage unit I/O service code (changing a jump destination by rewriting a table in an indirect jump of jumping to the jump destination registered in the table with referring to the table where the jump destination is registered). Owing to this, it is possible to boot the second OS without changing the bootstrap code of the firmware.
Moreover, it is different every OS what is the use of each memory area of the main storage unit. For this reason, in the present invention, for example, at the timing before detecting the termination of the first OS, the information for booting the second OS is temporarily written in an area, which is not overwritten under the control of the first OS, among memory areas of the main storage unit. For example, at the timing after detecting the termination of the first OS and before booting the second OS, it is preferable to relocate part or all of the information written (information used in at least current or later processing) at least in an area, which is not overwritten by booting the second OS, within the memory areas of the main storage unit. By relocating the information as described above, it is possible to prevent the information, which is relocated, from being overwritten and broken by booting the second OS, and it is possible to normally boot the second OS.
In addition, the area where the information is relocated can be an area that is not overwritten by booting the second OS and is not also overwritten under the control of the second OS after booting the second OS among memory areas of the main storage unit. Alternately, if the information relocated is not used after booting the second OS, the information can also be relocated in an area that is not overwritten by booting the second OS and is overwritten under the control of the second OS after booting the second OS.
Furthermore, in the present invention, programs (processing) to be executed in a state where the second OS is operating after booting the second OS in a computer are, for example, a firmware update program, a program performing network boot needing a specific protocol, a setup program, a computer system diagnostic program, and a program whose operation is not guaranteed in a state where the first OS is operating or that performs processing not suitable to execution in the state.
Moreover, in the present invention, in the case where the first OS has functions such as an automatic program boot function, and an automatic log-on function, by using these functions, it is also possible to automatically and continuously make a series of processing from booting the first OS in a computer at least to booting the second OS in the computer (or a series of processing including the execution of processing to be executed after booting the second OS). Owing to this, it is possible to reduce user""s work for booting the computer execute the series of processing.
In addition, the present invention is not limited to switching between two kinds of OSs, which are booted in a computer, but it is possible to boot an OS #3 in the computer by applying the present invention with booting an OS #2 a first OS according to the present invention to the computer in a state where the OS #2 is operating after booting the OS #2 in the computer by applying the present invention to the computer in a state where an OS #1 is operating. Therefore, by repeating the above procedure, it is possible to switch the OS, which is booted in the computer, among three or more kinds of OS.
Furthermore, it is also possible to realize the switching of the OS, which is booted in the computer, among three or more kinds of OSs, for example, by acquiring respectively the information, which is used for booting a plurality of OSs, which are different from each other, as the information for booting a second OS, which is different from a first OS, and booting one of the plurality of OSs, which is not executed yet, in the computer each time the termination of one of the plurality of OSs (termination of tie first OS or another OS) is detected.
Moreover, in the present invention, it is preferable to verify whether a user of the computer is an authorized user of the second OS before or after acquiring the information for booting the second OS. The verification of whether the user is an authorized user can be performed, for example, by prompting the user to input his/her password and checking the password, which is inputted, with a password registered beforehand. Owing to this, it is possible to prevent a person, who is not an authorized user, from acquiring the information for booting the second OS and booting the second OS in the computer, or from booting desired processing executed in a state where the second OS is operating.
In addition, in application programs on the second OS, programs that cannot operate depending on system configuration may be included. In such a case, it is possible to prevent a boot image of the second OS including application programs on the second OS from erroneously being booted and executed on a computer by prompting a user to input information relating to his/her system such as part of system configuration, or an ID number, or automatically acquiring the information from the system, and checking the information with the application programs on the second OS.
Furthermore, it is possible to prevent another person, who is not an authorized user, from invalidly using a computer under the second OS by booting the second OS after performing a protocol for verifying that the information for booting the second OS is not information invalidly tampered.
A computer according to an acquisition logic for acquiring information, which is used for booting a second OS and different from a first OS, under control of the first OS in a state where the first OS is operating on the computer; a write logic for writing the information, which is acquired by the acquisition logic, in a main storage unit of the computer; and a boot control logic for booting the second OS on the computer with the information written in the main storage unit without deleting the information written in the main storage unit by the write logic, when termination of the first OS is detected.
A storage medium recording a computer executable program, the program comprising the steps of acquiring information being used for booting a second OS and being different from a first OS, under control of the first OS in a state where the first OS is operating on the computer; writing the acquired information in a main storage unit of the computer; and booting the second OS on the computer with the information written in the main storage unit without deleting the information written in the main storage unit, when termination of the first OS is detected.